package com.learner.pojo.trade;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.*;

@Data
@Entity
@Table(name = "trade_pay_log")
@SQLDelete(sql = "update trade_pay_log set is_deleted = 1 where id = ?")
@Where(clause = "is_deleted = 0")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class PayLog implements Serializable {
    private static final long serialVersionUID = -1799777249331161645L;
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    private String  id;
    private String orderNo;
    private Date payTime;
    private Long totalFee;
    private String transactionId;
    private String tradeState;
    private Integer payType;
    private String attr;
    @Column(name="is_deleted")
    private Boolean deleted;
    @CreatedDate
    @Column(name = "gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @LastModifiedDate
    @Column(name = "gmt_modified")
    private Date gmtModified;
}
